From 57e76e2e7ff58646c4ef43f9e113c93668f98877 Mon Sep 17 00:00:00 2001 From: "shand@cosworth.eng.hq.xensource.com" Date: Tue, 30 Jan 2007 00:52:51 +0000 Subject: [PATCH] [HVM] When guest explicitly modifies the TSC, update platform timers _after_ updating guest time (since otherwise pt_reset() will get the old hvm_get_guest_time() and subsequently pt_intr_post() will warp the TSC back again). This is the smallest fix for the HVM SMP TSC issues seen on recent (viz. 2.6.18+) linux HVM kernels, but probably not the best. Cleaner fix needs more thought. Signed-off-by: Steven Hand --- xen/arch/x86/hvm/svm/svm.c | 2 +- xen/arch/x86/hvm/vmx/vmx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 7a656865eb..ff2d46896f 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -2141,8 +2141,8 @@ static inline void svm_do_msr_access( switch (ecx) { case MSR_IA32_TIME_STAMP_COUNTER: - pt_reset(v); hvm_set_guest_time(v, msr_content); + pt_reset(v); break; case MSR_IA32_SYSENTER_CS: vmcb->sysenter_cs = msr_content; diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 016fd0926a..f203ed9107 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2346,8 +2346,8 @@ static inline int vmx_do_msr_write(struct cpu_user_regs *regs) switch (ecx) { case MSR_IA32_TIME_STAMP_COUNTER: - pt_reset(v); hvm_set_guest_time(v, msr_content); + pt_reset(v); break; case MSR_IA32_SYSENTER_CS: __vmwrite(GUEST_SYSENTER_CS, msr_content); -- 2.30.2